<div class="page-bar">
    <ul class="page-breadcrumb">
        <li>
            <a href="#">WMS</a>
        </li>
        <li>
            <i class="fa fa-circle"></i>
            <a href="#">Task</a>
        </li>
        <li>
            <i class="fa fa-circle"></i>
            <a href="#">Put Away Task</a>
        </li>
    </ul>
</div>
<div class="portlet light bordered order-list-container" style="margin: 15px;">
    <div class="portlet-title">
        <div class="caption">
            <span class="caption-subject bold"> Put Away Task List </span>
        </div>
    </div>
    <div class="portlet-body form form-horizontal">
        <form>
            <div class="row form-group">
                <div class="col-md-3">
                    <label>Task ID:</label>
                    <lt-tags-input ng-model="search.taskIds" placeholder="Enter Task ID" fill="TASK-" ng-keyup="keyUpSearch($event)"></lt-tags-input>
                </div>
                <div class="col-md-3">
                    <label>Receipt ID:</label>
                    <input class="form-control" ng-model="search.receiptId" input-auto-fill="RN-" placeholder="Enter Receipt ID" ng-keyup="keyUpSearch($event)"/>
                </div>
                <div class="col-md-3">
                    <label>Assignee</label>
                    <user-auto-complete name="assignee" allow-clear="true"
                                        ng-model="search.assigneeUserId"></user-auto-complete>
                </div>
                <div class="col-md-3">
                    <label>Status:</label>
                    <task-status-auto-complete allow-clear="true" ng-model="search.status"></task-status-auto-complete>
                </div>
            </div>
            <div class="row form-group">
                <div class="col-md-3">
                    <label>Priority:</label>
                    <task-priority-auto-complete allow-clear="true" ng-model="search.priority"></task-priority-auto-complete>
                </div>
            </div>
            <div class="form-group form-actions right" style="padding: 0px;">
                <waitting-btn type="submit" btn-class="btn blue" ng-click="searchTasks()"
                              value="'search'" is-loading="searching"></waitting-btn>
            </div>
        </form>
        <div class="table-scrollable">
            <table class="table table-striped table-bordered table-hover">
                <thead>
                <tr>
                    <th>Task ID</th>
                    <th>Receive Task ID</th>
                    <th>Assignee</th>
                    <th>Status</th>
                    <th>Priority</th>
                    <th>Description</th>
                    <th>Date Created</th>
                    <th permission-check="{{'task::putAwayTask_write'}}">Actions</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="task in tasks">
                    <td><a ng-href="{{'#/wms/task/putaway-task/' + task.id}}" target="_blank">{{task.id}}</a></td>
                    <td><a  ng-href="{{'#/wms/task/receive-task/' + task.receiveTaskId}}" target="_blank">{{task.receiveTaskId}}</a></td>
                    <td>{{task.assignee.firstName}} {{task.assignee.lastName}}</td>
                    <td>{{task.status}}</td>
                    <td>{{task.priority}}</td>
                    <td>{{task.description}}</td>
                    <td>{{task.createdWhen | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}<span ng-show="task.createdBy">({{task.createdBy}})</span></td>
                    <!-- <td>{{task.updatedWhen | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}<span ng-show="task.updatedBy">({{task.updatedBy}})</span></td> -->
                    <td permission-check="{{'task::putAwayTask_write'}}">
                        <a ng-click="deleteTask(task.id)" ng-show="task.status == 'New'" title="Delete">Delete</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <pager total-count="paging.totalCount" current-page ="paging.pageNo" page-size="pageObj.pageSize"  load-content="loadContent(currentPage)"></pager>
    </div>
</div>